package com.topscore.uke.mvp.presenters;

import android.support.v7.view.menu.MenuView;
import android.view.View;

import com.topscore.uke.mvp.contractors.GetSmsCodeContractor;
import com.topscore.uke.mvp.contractors.GetSmsCodeContractor;
import com.topscore.uke.mvp.contractors.IndexPageFragmentContractor;
import com.topscore.uke.mvp.model.GetSmsCodeModel;

/**
 * Created by 71468 on 2017/9/13.
 */

public class GetSmsCodePresenter implements GetSmsCodeContractor, GetSmsCodeContractor.Presenter {
    private View view;

    public GetSmsCodePresenter(View view) {
        this.view = view;
    }
    @Override
    public void getSmsCode(String phone) {
        new GetSmsCodeModel(new Listener() {
            @Override
            public void onGetSuccess() {
                view.onGetCodeSuccess();
            }

            @Override
            public void onError(int errorCode, String errorMessage) {
                view.onFail(errorCode,errorMessage);
            }

            @Override
            public void onComplete() {
                view.onLoadFinished();
            }
        }).get(phone);
    }
}
